<?php //anchor ?>
<a name="map"></a>

<?php
//Register the script
$base = Yii::app()->baseUrl . '/mapmodule/';
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($base . 'swfobject.js');
?>


<?php //load the flash file ?>
<script type="text/javascript">

var MAP;
function flashStarted() {
    MAP = navigator.appName.indexOf("Microsoft") != -1 ? window["map"] : document["map"];
    MAP.goto(1,0);
}

var flashvars = {
    setImageServiceUrl:         "<?php echo $this->createUrl($this->module->id . '/../floor/setimage/'); ?>",
    getFloorServiceUrl:         "<?php echo $this->createUrl($this->module->id . '/../floor/getinfo/'); ?>",
    getFloorBuildingServiceUrl: "<?php echo $this->createUrl($this->module->id . '/../building/getinfoall/'); ?>",
    addRoomServiceUrl:          "<?php echo $this->createUrl($this->module->id . '/../ruangan/add/'); ?>",
    getRoomInfoServiceUrl:      "<?php echo $this->createUrl($this->module->id . '/../ruangan/getinfo/'); ?>",
    delRoomServiceUrl:          "<?php echo $this->createUrl($this->module->id . '/../ruangan/delete/'); ?>",
    updateRoomServiceUrl:       "<?php echo $this->createUrl($this->module->id . '/../ruangan/update/'); ?>",
    admin:                      <?php echo isset($admin) && $admin ? 1 : 0; ?>,
    notifyFunc:                 "flashStarted"
};
var params = {
    menu: "false",
    scale: "noScale",
    allowFullscreen: "true",
    allowScriptAccess: "always",
    bgcolor: "#FFFFFF"
};
var attr = {
    id:"map"
};
var swf = "<?php echo $base ?>ExternalInterface.swf";
var exp = "<?php echo $base ?>expressinstall.swf"
swfobject.embedSWF(swf, "altContent", "100%", "500px", "10.0.0", exp, flashvars, params, attr);
</script>

<div id="altContent">
        <p><a href="http://www.adobe.com/go/getflashplayer">Get Adobe Flash Player to display the map</a></p>
</div>

